<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue</title>
</head>
<script src="vue.js"></script>
<body>

    <div id="app">
        <li v-for=" v in comments" >
            {{v.content}}
        </li>
        <textarea v-model="current_content" cols="30" rows="10"></textarea>
        <button v-on:click="push">发表</button>
    </div>

<script>
    var app=new Vue({
        el:'#app',
        data: {
            current_content:'',
            comments:[
                {content:'前端申'},
                {content:'后端君'}
            ]
        },
        methods:{
            push(){
               var content={content:this.current_content}
                this.comments.push(content)
                this.current_content='';
            }
        }
    });

</script>
</body>
</html>